﻿using Xtensive.Orm;

namespace MultiColumnIndex.Model
{
    /*
     * To declare index for multiple columns use [Index] attribute and pass there a list of field names for indexing
     * Also you can set the desired index name, this is optional
     */
    [HierarchyRoot]
    [Index("FirstName", "LastName", Name = "IX_NAME")]
    public class Person : Entity
    {
        [Field, Key]
        public int Id { get; private set; }

        [Field]
        public string FirstName { get; set; }

        [Field]
        public string LastName { get; set; }

        public Person(Session session) :
            base(session)
        {}
    }
}